package cn.labelnet.android.roomdb.base.data.database

import android.arch.persistence.room.Database
import android.arch.persistence.room.RoomDatabase
import android.arch.persistence.room.TypeConverters
import cn.labelnet.android.roomdb.base.data.Converters
import cn.labelnet.android.roomdb.base.data.dao.BookDao
import cn.labelnet.android.roomdb.base.data.dao.UserDao
import cn.labelnet.android.roomdb.base.data.tables.BookTable
import cn.labelnet.android.roomdb.base.data.tables.UserTable

/**
 * Created by yuan on 02/08/2017.
 * 操作用户的 database
 */
@Database(entities = arrayOf(UserTable::class, BookTable::class), version = 1)
@TypeConverters(Converters::class)
abstract class AppDataBase : RoomDatabase() {

    /**
     *  user 操作 dao
     */
    abstract fun userDao(): UserDao

    /**
     * book 操作 dao
     */
    abstract fun bookDao(): BookDao

}